######################
# Master code
# Coalition formation
######################

# clear memory
rm(list=ls())

# set the working directory to the current file location!
# setwd()

library(rstan)



# CBQ estimations
t0 <- Sys.time()
source("replication_MS/cbq_ms_q1_s.R")
t1 <- Sys.time()
source("replication_MS/cbq_ms_q2_s.R")
t2 <- Sys.time()
source("replication_MS/cbq_ms_q3_s.R")
t3 <- Sys.time()
source("replication_MS/cbq_ms_q4_s.R")
t4 <- Sys.time()
source("replication_MS/cbq_ms_q5_s.R")
t5 <- Sys.time()
source("replication_MS/cbq_ms_q6_s.R")
t6 <- Sys.time()
source("replication_MS/cbq_ms_q7_s.R")
t7 <- Sys.time()
source("replication_MS/cbq_ms_q8_s.R")
t8 <- Sys.time()
source("replication_MS/cbq_ms_q9_s.R")
t9 <- Sys.time()

# substantive interpretation and quantile visualization
source("replication_MS/substantive_interpret_s.R")
source("replication_MS/ms_vis.R")
t10 <- Sys.time()

dur1 = t1 - t0
dur2 = t2 - t1
dur3 = t3 - t2
dur4 = t4 - t3
dur5 = t5 - t4
dur6 = t6 - t5
dur7 = t7 - t6
dur8 = t8 - t7
dur9 = t9 - t8
dur10 = t10 - t9
dur11 = t10 - t0



dur1
dur2
dur3
dur4
dur5
dur6
dur7
dur8
dur9
dur10
dur11


############################################################################################
# To reproduce the original figures and tables, please uncomment the following line
# source("replication_MS/archive/origin_coalition.R")




